package top.jolyoulu.core.framework.util

import org.apache.spark.SparkContext

/**
 * @Author: JolyouLu
 * @Date: 2024/5/15 18:22
 * @Description
 */
object EnvUtil {

  private val scLocal = new ThreadLocal[SparkContext]()

  def put(sc: SparkContext) = {
    scLocal.set(sc)
  }

  def take(): SparkContext = {
    scLocal.get()
  }

  def clear() = {
    scLocal.remove()
  }

}
